#include"tcpClient.hpp"
#include <memory>
#include <iostream>
#include <stdlib.h>
#include <string>

using namespace client;

static void Usage(const std::string &proc)
{
    std::cout << "\nUsage:\n\t" << proc << " server_port  server_ip\n\n";
}


int main(int argc, char *argv[])
{

    if (argc != 3)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port = atoi(argv[1]);
    std::string addr = argv[2];

    std::unique_ptr<TcpClient> pcli(new TcpClient(addr, port));
    pcli->initClient();
    pcli->start();
    return 0;
}